@extends('admin.layout.base')
@section('title', '上传商品图片')
@section('pluginstyle')
<link rel="stylesheet" type="text/css" href="{{ asset('/plugins/webuploader/webuploader.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('/common/upload/style.css') }}">
@endsection
@section('content')
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            上传商品图片
        </h1>
        <ol class="breadcrumb">
            <li><a href="{{ url('/admin') }}"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="{{ url('/admin/goods') }}">商品管理</a></li>
            <li class="active">上传商品图片</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <!-- right column -->
            <div class="col-md-12">
                <!-- Horizontal Form -->
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title">{{ $goods_name }}</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <div id="uploader">
                            <div class="queueList">
                                <div id="dndArea" class="placeholder">
                                    <div id="uploadmore"></div>
                                    <p>或将照片拖到这里，单次最多可选5张</p>
                                </div>
                            </div>
                            <div class="statusBar" style="display:none;">
                                <div class="progress">
                                    <span class="text">0%</span>
                                    <span class="percentage"></span>
                                </div><div class="info"></div>
                                <div class="btns">
                                    <div id="filePicker2"></div><div class="uploadBtn">开始上传</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.box -->
            </div>
            <!--/.col (right) -->
        </div>
        <!-- /.row -->
    </section>
    <!-- /.content -->
</div>
@endsection
@section('pluginscript')
<!-- FastClick -->
<script src="{{ asset('/dist/admin/plugins/fastclick/fastclick.js') }}"></script>
<script type="text/javascript" src="{{ asset('/plugins/webuploader/webuploader.js') }}"></script>
<script type="text/javascript" src="{{ asset('/common/js/upload.js') }}"></script>
<script type="text/javascript">
$(function() {
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    uploadMore('#uploadmore', "{{ url('/admin/album/add',['id'=>$goods_id]) }}");
});
</script>
@endsection